/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pojo;

import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 *
 * @author pvhuy
 */
@Entity
@Table(name = KhachHang.TABLE_KHACHHANG)
public class KhachHang extends Base {

    public static final String TABLE_KHACHHANG = "KhachHang";
    protected static final String COLUMN_HOTEN = "HoTen";
    private static final int LENGTH_HOTEN = 45;
    @Column(name = COLUMN_HOTEN, length = LENGTH_HOTEN, nullable = false)
    private String hoTen;

    protected static final String COLUMN_EMAIL = "Email";
    private static final int LENGTH_EMAIL = 45;
    @Column(name = COLUMN_EMAIL, length = LENGTH_EMAIL)
    private String email;

    protected static final String COLUMN_DIENTHOAI = "DienThoai";
    private static final int LENGTH_DIENTHOAI = 45;
    @Column(name = COLUMN_DIENTHOAI, length = LENGTH_DIENTHOAI)
    private String dienThoai;

    protected static final String COLUMN_DIACHI = "MaDiaChi";
    @OneToOne(cascade = CascadeType.ALL)
    @JoinColumn(name = COLUMN_DIACHI)
    private DiaChi diaChi;
    
    @OneToMany(mappedBy = "khachHang", cascade = CascadeType.ALL)
    private List<DonDatHang> danhSachDonDatHang;
    
    private String xacNhanEmail;

    /**
     * @return the hoTen
     */
    public String getHoTen() {
        return hoTen;
    }

    /**
     * @param hoTen the hoTen to set
     */
    public void setHoTen(String hoTen) {
        this.hoTen = hoTen;
    }

    /**
     * @return the email
     */
    public String getEmail() {
        return email;
    }

    /**
     * @param email the email to set
     */
    public void setEmail(String email) {
        this.email = email;
    }

    /**
     * @return the dienThoai
     */
    public String getDienThoai() {
        return dienThoai;
    }

    /**
     * @param dienThoai the dienThoai to set
     */
    public void setDienThoai(String dienThoai) {
        this.dienThoai = dienThoai;
    }

    /**
     * @return the diaChi
     */
    public DiaChi getDiaChi() {
        return diaChi;
    }

    /**
     * @param diaChi the diaChi to set
     */
    public void setDiaChi(DiaChi diaChi) {
        this.diaChi = diaChi;
    }

    /**
     * @return the danhSachDonDatHang
     */
    public List<DonDatHang> getDanhSachDonDatHang() {
        return danhSachDonDatHang;
    }

    /**
     * @param danhSachDonDatHang the danhSachDonDatHang to set
     */
    public void setDanhSachDonDatHang(List<DonDatHang> danhSachDonDatHang) {
        this.danhSachDonDatHang = danhSachDonDatHang;
    }

    public String getXacNhanEmail() {
        return xacNhanEmail;
    }

    public void setXacNhanEmail(String xacNhanEmail) {
        this.xacNhanEmail = xacNhanEmail;
    }

    
}
